﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net.Http;
using System.Text;
using System.Threading.Tasks;

namespace Aribaccio.Core
{
    /// <summary>
    /// HttpClient服务接口
    /// </summary>
    public interface IHttpClientService
    {
        /// <summary>
        /// HttpClient的Post方法
        /// [适用WebService]
        /// </summary>
        /// <param name="argUrl">Url地址</param>
        /// <param name="content">HttpContent内容对象</param>
        /// <returns>读取数据字符串</returns>
        string PostAsyncToHttpContent(string argUrl, HttpContent content);
        /// <summary>
        /// HttpClient的Post方法
        /// [适用WebService]
        /// </summary>
        /// <param name="argUrl">Url地址</param>
        /// <param name="argDictParams">参数字典</param>
        /// <returns>读取数据字符串</returns>
        string PostAsyncToHttpContentParams(string argUrl, Dictionary<string, string> argDictParams);

        /// <summary>
        /// HttpClient的Post方法
        /// [适用RESTful风格]
        /// </summary>
        /// <param name="argUrl">Url地址</param>
        /// <param name="content">Json序列化字符串</param>
        /// <returns>读取数据字符串</returns>
        string? PostAsyncToStringContent(string argUrl, string? argJsonContent = null);
        /// <summary>
        ///  HttpClient的Post方法
        /// [适用RESTful风格]
        /// </summary>
        /// <typeparam name="T">泛型模型</typeparam>
        /// <param name="argUrl">Url地址</param>
        /// <param name="argItems">泛型对象</param>
        /// <returns>读取数据字符串</returns>
        string? PostAsyncToStringContentModel<T>(string argUrl, T argItem);
        /// <summary>
        ///  HttpClient的Post方法
        /// [适用RESTful风格]
        /// </summary>
        /// <typeparam name="T">泛型模型</typeparam>
        /// <param name="argUrl">Url地址</param>
        /// <param name="argItems">泛型对象集合</param>
        /// <returns>读取数据字符串</returns>
        string? PostAsyncToStringContentModel<T>(string argUrl, List<T> argItems);
    }
}
